package a01_Array;

/**
 * @Author quan
 * @Description 求数组的平均值
 * @Date 2023/2/28 19:54
 */
public class AvgArray {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,8,9,6};
        double res = getAvgArr(arr);
        System.out.println(res);
    }
    public static double getAvgArr(int[] arr){
        int sum = 0;
        for(int i:arr){
            sum+=i;
        }
        double res=(sum)/(double)arr.length;
        return res;
    }
}
